package com.xqx.pojo;


import tk.mybatis.mapper.annotation.KeySql;

import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;

/**
 * 用户实体类
 * @author xqx
 */
@Table(name = "tb_user")
public class User {

  @Id
  /**
   * id
   * 开启主键自动回填
   */
  @KeySql(useGeneratedKeys = true)
  private Long id;
  /**
   * 用户名
   */
  private String userName;
  private String password;
  private String name;
  private Integer age;
  /**
   * 性别， 1 男性  2 女性
   */
  private Integer sex;
  private Date birthday;
  private String note;
  private Date created;
  private Date updated;

  public User() {
  }

  public Long getId() {
    return this.id;
  }

  public String getUserName() {
    return this.userName;
  }

  public String getPassword() {
    return this.password;
  }

  public String getName() {
    return this.name;
  }

  public Integer getAge() {
    return this.age;
  }

  public Integer getSex() {
    return this.sex;
  }

  public Date getBirthday() {
    return this.birthday;
  }

  public String getNote() {
    return this.note;
  }

  public Date getCreated() {
    return this.created;
  }

  public Date getUpdated() {
    return this.updated;
  }

  public void setId(Long id) {
    this.id = id;
  }

  public void setUserName(String userName) {
    this.userName = userName;
  }

  public void setPassword(String password) {
    this.password = password;
  }

  public void setName(String name) {
    this.name = name;
  }

  public void setAge(Integer age) {
    this.age = age;
  }

  public void setSex(Integer sex) {
    this.sex = sex;
  }

  public void setBirthday(Date birthday) {
    this.birthday = birthday;
  }

  public void setNote(String note) {
    this.note = note;
  }

  public void setCreated(Date created) {
    this.created = created;
  }

  public void setUpdated(Date updated) {
    this.updated = updated;
  }

  public boolean equals(final Object o) {
    if (o == this) return true;
    if (!(o instanceof User)) return false;
    final User other = (User) o;
    if (!other.canEqual((Object) this)) return false;
    final Object this$id = this.getId();
    final Object other$id = other.getId();
    if (this$id == null ? other$id != null : !this$id.equals(other$id)) return false;
    final Object this$userName = this.getUserName();
    final Object other$userName = other.getUserName();
    if (this$userName == null ? other$userName != null : !this$userName.equals(other$userName)) return false;
    final Object this$password = this.getPassword();
    final Object other$password = other.getPassword();
    if (this$password == null ? other$password != null : !this$password.equals(other$password)) return false;
    final Object this$name = this.getName();
    final Object other$name = other.getName();
    if (this$name == null ? other$name != null : !this$name.equals(other$name)) return false;
    final Object this$age = this.getAge();
    final Object other$age = other.getAge();
    if (this$age == null ? other$age != null : !this$age.equals(other$age)) return false;
    final Object this$sex = this.getSex();
    final Object other$sex = other.getSex();
    if (this$sex == null ? other$sex != null : !this$sex.equals(other$sex)) return false;
    final Object this$birthday = this.getBirthday();
    final Object other$birthday = other.getBirthday();
    if (this$birthday == null ? other$birthday != null : !this$birthday.equals(other$birthday)) return false;
    final Object this$note = this.getNote();
    final Object other$note = other.getNote();
    if (this$note == null ? other$note != null : !this$note.equals(other$note)) return false;
    final Object this$created = this.getCreated();
    final Object other$created = other.getCreated();
    if (this$created == null ? other$created != null : !this$created.equals(other$created)) return false;
    final Object this$updated = this.getUpdated();
    final Object other$updated = other.getUpdated();
    if (this$updated == null ? other$updated != null : !this$updated.equals(other$updated)) return false;
    return true;
  }

  protected boolean canEqual(final Object other) {
    return other instanceof User;
  }

  public int hashCode() {
    final int PRIME = 59;
    int result = 1;
    final Object $id = this.getId();
    result = result * PRIME + ($id == null ? 43 : $id.hashCode());
    final Object $userName = this.getUserName();
    result = result * PRIME + ($userName == null ? 43 : $userName.hashCode());
    final Object $password = this.getPassword();
    result = result * PRIME + ($password == null ? 43 : $password.hashCode());
    final Object $name = this.getName();
    result = result * PRIME + ($name == null ? 43 : $name.hashCode());
    final Object $age = this.getAge();
    result = result * PRIME + ($age == null ? 43 : $age.hashCode());
    final Object $sex = this.getSex();
    result = result * PRIME + ($sex == null ? 43 : $sex.hashCode());
    final Object $birthday = this.getBirthday();
    result = result * PRIME + ($birthday == null ? 43 : $birthday.hashCode());
    final Object $note = this.getNote();
    result = result * PRIME + ($note == null ? 43 : $note.hashCode());
    final Object $created = this.getCreated();
    result = result * PRIME + ($created == null ? 43 : $created.hashCode());
    final Object $updated = this.getUpdated();
    result = result * PRIME + ($updated == null ? 43 : $updated.hashCode());
    return result;
  }

  public String toString() {
    return "User(id=" + this.getId() + ", userName=" + this.getUserName() + ", password=" + this.getPassword() + ", name=" + this.getName() + ", age=" + this.getAge() + ", sex=" + this.getSex() + ", birthday=" + this.getBirthday() + ", note=" + this.getNote() + ", created=" + this.getCreated() + ", updated=" + this.getUpdated() + ")";
  }
}
